﻿@{
    ViewBag.Title = "OpPartition";
    Layout = "~/Views/Shared/_ViewFormPage.cshtml";
}
@section head{
    <script type="text/javascript">
        $(function () {
            $("#btnSave").click(function () {
                if ($("form").valid()) {
                    $('form').ajaxSubmit({
                        success: function (callback) {
                            if (callback) {
                                $.messageTip().show("保存成功！",2000, function() {
                                    self.location.href = "/Article/Partition";
                                });
                            }
                            else {
                                $.messageTip().show("保存失败！");
                            }
                        },
                        error: function (ex) {
                            $.messageTip().show("保存失败！");
                        }

                    });
                }
            });


        });
    </script>
            
}
    @model PartitionVM
    <div id="header" class="header">
        <h4>模块分类 -- 添加</h4>
    </div>

    @using (Html.BeginForm("OpPartition", "Article", FormMethod.Post))
    {
        <div id="detail_forms">

            <div class="formsItems clearfix">
                <div class="formItem labelItem">
                    所属模块
                </div>
                <div class="formItem textItem">
                    @Html.DropDownListFor(model => Model.ParentId, Model.Roots)
                </div>
                <div class="formItem msgItem">
                
                </div>
            </div>
         
            <div class="formsItems clearfix">
                <div class="formItem labelItem">
                    模块名称
                </div>
                <div class="formItem textItem">
                    @Html.TextBoxFor(model => model.Name, new {@class = "texts"})
                </div>
                <div class="formItem msgItem">
                    * 至少填写两个字符
                </div>
            </div>
         
            <div class="formsItems clearfix">
                <div class="formItem labelItem">
                    模块描述
                </div>
                <div class="formItem textItem">
                    @Html.TextBoxFor(model => model.Name, new {@class = "texts"})
                </div>
                <div class="formItem msgItem">
                
                </div>
            </div>
         
            <div class="formsItems clearfix">
                <div class="formItem labelItem">
                    是否启用
                </div>
                <div class="formItem textItem">
                    @Html.CheckBoxFor(model=>model.BEnabled,new { @class = "ifunny-checkbox"})
                </div>
                <div class="formItem msgItem">
                
                </div>
            </div>

            <div id="btnContainer" class="formsItems">
                <div class="formItem labelItem">
                    &nbsp;
                </div>
                <div class="formItem textItem">
                    <a href="javascript:void(0);" id="btnSave">保存</a>
                    <a href="@Url.Action("Partition")" id="btnCancel">取消</a>
                </div>
                <div class="formItem">
                </div>
            </div>
        </div>
    }